//
//  CALayer+extension.m
//  WTMSeller
//
//  Created by lxj on 2018/2/22.
//  Copyright © 2018年 LQ. All rights reserved.
//

#import "CALayer+extension.h"

@implementation CALayer (extension)

- (instancetype)initWithFame:(CGRect)frame cornerRadius:(CGFloat)cornerRadius backgroundColor:(UIColor *)backgroundColor shadowColor:(UIColor *)shadowColor shadowOffset:(CGSize)shadowOffset shadowOpacity:(float)shadowOpacity shadowRadius:(CGFloat)shadowRadius{
    if (self = [self init]) {
        self.frame = frame;
        self.cornerRadius = cornerRadius;
        self.backgroundColor = backgroundColor.CGColor;
        self.masksToBounds = NO;
        self.shadowColor =  shadowColor.CGColor;//shadowColor阴影颜色
        self.shadowOffset = shadowOffset;//shadowOffset阴影偏移,x向右偏移3，y向下偏移2，默认(0, -3),这个跟shadowRadius配合使用
        self.shadowOpacity = shadowOpacity;//阴影透明度，默认0
        self.shadowRadius = shadowRadius;//阴影半径，默认3
    }
    return self;
}

@end
